<?php
$this->frontend_lib->setACss(shop_assets('css/smoothproducts.css', $this->shop->template));
$this->frontend_lib->setAJs(shop_assets('js/smoothproducts.min.js', $this->shop->template));
?>


<?php
$item = $productDetails[0];
$div_desc = "";
?>

<div class="row">
    <div class="col-md-12 col-xs-12">
        <h2 class="text-uppercase clear-bdr"><?php echo $pageTitle; ?></h2>
    </div>

    <div class="breadcrumbDiv col-lg-12">
        <ul class="breadcrumb">
            <li><a class="text-uppercase" href="<?php echo shop_url($this->shop->getSlug()); ?>">Trang chủ</a></li>
            <li><a class="text-uppercase" href="<?php echo shop_url($this->shop->getSlug().'/'.CATEGORY_SLUG.'/'.$product->shop_cate_slug); ?>"><?php echo $product->shop_cate_title; ?></a></li>
            <li class="active"><span class="text-uppercase"><?php echo $product->getTitle(); ?></span></li>
        </ul>
    </div>
</div>

<div class="row transitionfx">
    <!-- left column -->
    <div class="col-lg-6 col-md-6 col-sm-6">
        <!-- product Image and Zoom -->
        <div class="main-image sp-wrap col-lg-12 no-padding">
            <?php foreach($productDetails as $index=>$itm) { ?>
            <a href="<?php echo product_upload($itm->image, $product->shop_image_folder); ?>">
                <img src="<?php echo product_upload($itm->image, $product->shop_image_folder); ?>" alt='<?php echo $itm->getCode(); ?>'/>
            </a>
            <?php
                $div_desc .= '<p>' . $itm->getDescription() . '</p>';
                $selected_option = $itm->getIsAvatar()==ON?"selected='selected'":"";
                $select_option .= "<option {$selected_option}>".$itm->getCode()."</option>";
            ?>
            <?php } ?>
        </div>
    </div><!--/ left column end -->

    <!-- right column -->
    <div class="col-lg-6 col-md-6 col-sm-5">
        <form has-validate id="frm-product-detail" method="post" action="<?php echo page_url('cart/direct-push'); ?>">
            <input type="hidden" id="product-id" name="cart[id]" value="<?php echo $item->getId(); ?>" />
            <input type="hidden" id="product-price" name="cart[price]" value="<?php echo $item->getPriceNew(); ?>" />
            <h1 class="product-title"><?php echo $product->getTitle(); ?></h1>
            <h3 class="product-code">Mã sản phẩm : <?php echo $item->getCode(); ?></h3>
            <div class="product-price">
                <span class="price-sales"> <?php echo currency_format($item->getPriceNew()); ?></span>
                <span class="price-standard"><?php echo currency_format($item->getPriceOld()); ?></span>
            </div>
            <div class="productFilter productFilterLook2">
                <div class="filterBox">
                    <select class="form-control w100"><?php echo $select_option; ?></select>
                    <br />
                    <input autocomplete="off" id="product-qty" name="cart[qty]" type="text" class="form-control w100 text-right" value="1"/>
                </div>
            </div>
            <div id="flg_message" class="alert alert-success hidden mgt-10"></div>
            <!-- productFilter -->
            <div class="cart-actions">
                <div class="addto">
                    <button class="btn btn-info btn-fill" role="button"><i class="fa fa-check-circle"></i>&nbsp; Mua ngay</button>
                    <button data-href="<?php echo page_url('cart/push'); ?>" id="btn-add-to-cart" type="button" class="btn btn-info"><i class="fa fa-shopping-cart"></i> Cho vào giỏ hàng</button>
                </div>
                <div style="clear:both"></div>
            </div>
        </form>
        <!--/.cart-actions-->
        <div class="clear"></div>
        <div class="product-tab w100 clearfix">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#details" data-toggle="tab">Mô tả</a></li>
                <li> <a href="#shipping" data-toggle="tab">Phương thức thanh toán</a></li>
                <li> <a href="#size" data-toggle="tab">Đánh giá &amp; BÌNH LUẬN</a></li>
            </ul>
            <!-- Tab panes -->
            <div class="tab-content">
                <div class="tab-pane active" id="details">
                    <?php echo $div_desc; ?>
                </div>
                <div class="tab-pane" id="shipping">
                    <?php echo $this->shop->getPaymentMethod(); ?>
                </div>
                <div class="tab-pane" id="size">
                    <div class="fb-comments" data-width="100%" data-href="<?php echo product_url($product->getSlug()); ?>" data-numposts="5" data-colorscheme="light"></div>
                </div>
            </div> <!-- /.tab content -->
        </div><!--/.product-tab-->
        <div style="clear:both"></div>
        <div class="product-share clearfix">
            <p> SHARE </p>
            <div class="socialIcon">
                <a href="#"> <i class="fa fa-facebook"></i></a>
                <a href="#"> <i class="fa fa-twitter"></i></a>
                <a href="#"> <i class="fa fa-google-plus"></i></a>
                <a href="#"> <i class="fa fa-pinterest"></i></a>
            </div>
        </div>
        <!--/.product-share-->
    </div><!--/ right column end -->
</div>
<!--/.row-->